import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import Layout from '../views/Layout.vue'

const routes: RouteRecordRaw[] = [
  {
    path: '/hf-ui',
    // redirect: '/home',
    component: Layout,
    // children: [
    //   {
    //     path: '/login',
    //     component: () => import('../login/Login.vue'),
    //   },
    //   {
    //     path: '/home',
    //     component: () => import('../echarts/pie.vue'), // 框架页
    //   },
    // ],
  },
  {
    path: '/hf-ui/second',
    meta: {
      icon: 'el-icon-tools',
      title: '二次封装',
    },
    component: Layout,
    children: [
      {
        path: 'navside',
        meta: {
          title: '侧边',
          icon: 'el-icon-bicycle',
        },
        component: () => import('../views/Side.vue'),
      },
      {
        path: 'icons',
        meta: {
          title: '图标选择',
          icon: 'el-icon-icetea',
        },
        component: () => import('../views/ChooseIcon.vue'),
      },
      {
        path: 'area',
        meta: {
          title: '地区选择',
          icon: 'el-icon-addlocation',
        },
        component: () => import('../views/ChooseArea.vue'),
      },
      {
        path: 'trend',
        meta: {
          title: '趋势图标',
          icon: 'el-icon-addlocation',
        },
        component: () => import('../views/Trend.vue'),
      },
      {
        path: 'notification',
        meta: {
          title: '通知',
          icon: 'el-icon-bellfilled',
        },
        component: () => import('../views/Notification.vue'),
      },
      {
        path: 'menu',
        meta: {
          title: '菜单',
          icon: 'el-icon-menu',
        },
        component: () => import('../views/Menu.vue'),
      },
      {
        path: 'progress',
        meta: {
          title: '动画进度条',
          icon: 'el-icon-darrowright',
        },
        component: () => import('../views/Progress.vue'),
      },
      {
        path: 'chooseCity',
        meta: {
          title: '城市选择',
          icon: 'el-icon-shop',
        },
        component: () => import('../views/ChooseCity.vue'),
      },
      {
        path: 'form',
        meta: {
          title: '表单',
          icon: 'el-icon-scaletooriginal',
        },
        component: () => import('../views/Form.vue'),
      },
      {
        path: 'dialogForm',
        meta: {
          title: '弹窗表单',
          icon: 'el-icon-hotwater',
        },
        component: () => import('../views/DialogForm.vue'),
      },
      {
        path: 'table',
        meta: {
          title: '表格',
          icon: 'el-icon-creditcard',
        },
        component: () => import('../views/Table.vue'),
      },
    ]
  }
]

const router = createRouter({
  routes,
  history: createWebHistory(),
})

export default router
